package itbour.onetouchshow.constants;

import android.text.TextUtils;

import itbour.onetouchshow.utils.sharedpreference.PreferencesHelper;

/**
 * Created by onetouch on 2017/11/21.
 */

public class AppConfig {

    public static final boolean IS_DEBUG_MODULE = true;

    //    public static final String DEFAULT_ENCRYPT_BASE="https://mobile.itbour.com/";
    public static final String DEFAULT_ENCRYPT_BASE = "http://test.itbour.com:2918/";
    public static final String HTTP_ENCRYPT_BASE = getAppServiceAddress();
    /**
     * WEB
     */
    public static final String HTTP_ENCRYPT_ENDDING_WEB = HTTP_ENCRYPT_BASE + "encrypt/encrypt?";
    /*分享URL*/
    //public static final String SHARE = "http://test.itbour.com:3011/yjx/v1_0_0/outside/share?v=";
    /*分享URL*/
    //public static final String CustomSHARE = "http://test.itbour.com:3011/yjx/v1_0_0/outside/v2_1_share.html?v=";
    //通用字段
    public static final String ISCOLLECT = "isCollect";


    /*分享URL 外网 */
    public static final String SHARE = "https://yjxapphome.itbour.com/yjx/v1_0_0/outside/share?v=";


    /*分享URL 外网 */
    public static final String CustomSHARE = "https://yjxapphome.itbour.com/yjx/v1_0_0/outside/v2_1_share.html?v=";
    /**
     * 第三方登陆
     */
    //public final static String THIRD_lOGIN = "/yjx/v1/user/loginByThirdPlatform_v1_0";
    public final static String THIRD_lOGIN = "/yjx/v1/user/loginByThirdPlatform_v1_0_1";
    public final static String GET_CODE = "/yjx/v1/user/getMobileVerCode_v1_0";
    //验证码登录
    public final static String CODE_LOIGN = "/yjx/v1/user/loginByMobileCode_v1_0";
    // 微信登录
    public final static int YJX_THIRD_LOGIN_PLATFORM_WECHAT = 20;
    /**
     * 获取 APP 基础信息
     */
    public final static String GET_APPBASE_INFO_V10 = "/yjx/v1/sundry/getAppBaseInfo_v1_3";
    //获取模板预览
    public final static String GET_VERTICAL_MODEL_PREVIEW_V10 = "/yjx/v1/document/getTmplDetail_v1_0";
    //获取模板收藏状态
    public final static String GET_THIS_MODEL_ISCOLLECT_V10 = "/yjx/v1/document/getTmplCollectStatus_v1_0";
    //收藏或取消搜藏模板
    public final static String SET_CANCEL_MODEL_COLLECT_V10 = "/yjx/v1/document/setTmplCollectStatus_v1_0";
    //获取模板/作品核心数据
    public final static String GET_DOC_CONTENT_V10 = "/yjx/v1/document/getDocContent_v1_0";
    //获取视频 微调数据
    public final static String GETVIDEODOCBGINFO_V1_0 = "/yjx/v1/document/getVideoDocBgInfo_v1_0";
    //创建作品
    public final static String CREATE_DOC_V10 = "/yjx/v1/document/newUserDoc_v1_0";
    //获取作品预览 如果没排版 现在排版
    public final static String GET_DOC_PREVIEW_V10 = "/yjx/v1/document/getDocPreview_v1_0";
    //获取文字轮廓信息
    public final static String GET_CONTOUROF_TEXTS_V10 = "/yjx/v1/document/getContourOfTexts_v1_0";
    //创建去水印订单
    public final static String GET_CREATEWATERMARKORDER_V1_0 = "/yjx/v1/order/createWatermarkOrder_v1_0";
    public final static String GETORDERPAYPARAM_V1_0 = "/yjx/v1/order/getOrderPayParam_v1_0";

    /*获取支付参数*/
    /*获取列表数据*/
    public final static String GETTMPLSETCONTENT_V1_0 = "/yjx/v1/document/getTmplSetContent_v1_0";
    /*获取收藏列表数据*/
    public final static String GETUSERCOLLECTLIST_V1_0 = "/yjx/v1/user/getUserCollectList_v1_0";
    /*获取收藏列表数据V1.3*/
    public final static String GETUSERCOLLECTLIST_V1_3 = "/yjx/v1/user/getUserCollectList_v1_3";
    /*获取作品列表数据*/
    public final static String GETUSERWORKLIST_V1_0 = "/yjx/v1/user/getUserWorkListForWeb_v1_0";
    //获取作品列表V3.0
    public final static String GET_USER_WORK_LIST_V3_0 = "/yjx/v1/user/getUserWorkListForWeb_v1_0";
    /*获取作品列表数据*/
    public final static String REMOVEUSERDOC_V1_0 = "/yjx/v1/user/removeUserDoc_v1_0";
    /*修改名称*/
    public final static String RENAMEUSERDOC_V1_0 = "/yjx/v1/user/renameUserDoc_v1_0";
    /*用户数据中心*/
    public final static String GETPERSONALCENTERINFO_V1_0 = "/yjx/v1/user/getPersonalCenterInfo_v1_0";
    /*用户详情*/
    public final static String GETUSERDETAILINFO_V1_0 = "/yjx/v1/user/getUserDetailInfo_v1_0";
    /*得到用户订单*/
    public final static String GETUSERORDERLIST_V1_1 = "/yjx/v1_0_0/order/getUserOrderList_v1_1";
    /*预支付订单 */
    public final static String GETPREWATERMARKORDERINFO_V1_0 = "/yjx/v1_0_0/order/getPreWatermarkOrderInfo_v1_0";
    public final static String GET_VIP_PAY_CREATR_ORDER_PAGE = "/yjx/v1_0_0/order/getPreVipOrderInfo_v1_0";
    /*用户搜索*/
    public final static String SEARCHTEMPLETE_V1_0 = "/yjx/v1/sundry/searchTemplete_v1_0";
    /*用户资料修改*/
    public final static String UPDATEUSERINFO_V1_0 = "/yjx/v1/user/updateUserInfo_v1_0";
    /*获取OSS*/
    public final static String GETOSSSIGN_V1_0 = "/yjx/v1/sundry/getOssSign_v1_0";
    /*获取作品核心数据*/
    public final static String GETUSERDOCCOPYTMPL_V1_0 = "/yjx/v1/document/getUserDocCopyTmpl_v1_0";
    /*获取热门搜索数据*/
    public final static String GETHOTSEARCH_V1_0 = "/yjx/v1/sundry/getHotSearch_v1_0";
    /* 获取作品预览 */
    @Deprecated
    public final static String GETDOCPREVIEW_V1_0 = "/yjx/v1/document/getDocPreview_v1_0";
    public final static String REQUESTUSERDOCPRIVEWINFO_WEB_V1_1 = "/yjx/v1/document/requestUserDocPrivewInfo_web_v1_1";
    /* 设置视频背景 */
    public final static String SETVIDEOBG_V1_0 = "/yjx/v1/document/setVideoBG_v1_0";
    /* 获取视频可用背景列表 */
    public final static String GETVIDEOUSERDOCBGLIST_V1_0 = "/yjx/v1/document/getVideoUserDocBgList_v1_0";
    /*上传阿里云路径*/
    public final static String UPLOAD_ALYUN = "http://itbour-user.oss-cn-hangzhou.aliyuncs.com/";
    /*创建作品*/
    public final static String NEWUSERDOC_V1_0 = "/yjx/v1/document/newUserDoc_v1_0";
    //修改作品
    public final static String UPDATE_USERDOC_V1_0 = "/yjx/v1/document/updateUserDoc_v1_0";
    /*去水印*/
    public final static String REMOVEWATERMARK_V1_0 = "/yjx/v1/document/removeWatermark_v1_0";
    /*AboutME*/
    public final static String ABOUT_ME_V1_0 = "/yjx/v1_0_0/user/we";
    /*用户协议*/
    public final static String USERAGREEMENT_V1_0 = "/yjx/v1_0_0/user/userAgreement";
    /*支付协议*/
    public final static String PAYAGREEMENT_V1_0 = "/yjx/v1_0_0/user/payAgreement";
    /*秀米疑难解答*/
    public final static String XIU_MI_QA = "/yjx/v1_0_0/user/qa";
    /*VIP协议*/
    public final static String VIP_AGREEMENT = "/yjx/v1_0_0/user/vipAgreement";
    /**
     * 购买秀米套餐
     */
    public final static String V1_6_XMPACKAGE = "/yjx/v1_0_0/order/v1_6_xmPackage.html";
    /*修改作品*/
    public final static String UPDATEUSERDOC_V1_0 = "/yjx/v1/document/updateUserDoc_v1_0";
    /*添加表单*/
    public final static String ADDFORM = "/yjx/v1_0_0/user/addForm";
    /*表单用户反馈*/
    public final static String FREEBACKINFO = "/yjx/v1_0_0/user/freebackInfo";
    /*清空视频背景*/
    public final static String CLEARVIDEOBG_V1_0 = "/yjx/v1/document/clearVideoBG_v1_0";
    /*用户意见反馈*/
    public final static String SENDFEEDBACK_V1_0 = "/yjx/v1/user/sendFeedback_v1_0";
    /*获取下载地址*/
    public final static String GETDOCDOWNLOADURL_V1_0 = "/yjx/v1/document/getDocDownloadUrl_v1_0";
    /*修改视频背景*/
    public final static String UPDATEVIDEODOCBG_V1_0 = "/yjx/v1/document/updateVideoDocBg_v1_0";
    /*获取Banner*/
    public final static String GETAPPBANNERINFO_V1_1 = "/yjx/v1/sundry/getAppBannerInfo_v1_1";


    /*核心数据拷贝 */
    // public final static String GETUSERDOCCOPYTMPL_V1_0 = "/yjx/v1/document/getUserDocCopyTmpl_v1_0";
    /*获取APP更新*/
    public final static String GETLASTVERSION_V1_0 = "/yjx/v1/sundry/getLastVersion_v1_0";
    /*获取错误日志*/
    public final static String UPLOADAPPERRLOG_V1_0 = "/yjx/v1/sundry/uploadAppErrLog_v1_0";
    //获取背景模板/视频作品背景信息_APP_v1_2 添加
    public final static String GETVIDEOBGINFO_V1_2 = "/yjx/v1/document/getVideoBgInfo_v1_2";
    /*获取背景微调*/
    //修改视频背景
    public final static String UPDATEVIDEODOCBG_V1_2 = "/yjx/v1/document/updateVideoDocBg_v1_2";
    public final static String SETVIDEOUSERDOCCOVER_V1_3 = "/yjx/v1/document/setVideoUserDocCover_v1_3";
    //删除视频作品封面_APP_1_3 添加
    public final static String REMOVEVIDEOUSERDOCCOVER_V1_3 = "/yjx/v1/document/removeVideoUserDocCover_v1_3";
    public final static String GETAPPHOMEPAGEINFO_V1_3 = "/yjx/v1/sundry/getAppHomePageInfo_v1_3";
    //获取作品视频关键帧时刻信息_APP_1_3 添加
    public final static String GETUSERDOCKEYFRAMETIMES_V1_3 = "/yjx/v1/sundry/getUserDocKeyFrameTimes_v1_3";
    public final static String ALIYUNCSENDPOINT = "http://oss-cn-hangzhou.aliyuncs.com";
    //获取用户秀米余额
    public final static String GET_USER_BALANCE = "/yjx/v1/user/getUserCurrentUserPoints_web_v1_1";
    //获取用户秀米记录
    public final static String GET_POINTSDETAIL_LIST = "/yjx/v1/user/getUserPointsDetailList_web_v1_1";
    //获取Vip页面信息
    public final static String GET_VIP_PAGE_INFO = "/yjx/v1/sundry/getAppVipInfo_v1_4";
    //创建Vip商品订单
    public final static String CREATE_VIP_ORDER_INFO = "/yjx/v1/order/createVipOrder_web_v1_1";
    //我的收益
    public final static String MY_PROFIT = "/yjx/v1_0_0/user/v1_8_myprofit.html";
    //我的挑战
    public final static String MY_CHALLENGE = "/yjx/v1_0_0/user/v1_8_mychallenge.html";
    //挑战专区
    public final static String CHALLENGE_AREA = "/yjx/v1_0_0/user/v1_8_challenge_area.html";
    //用户自定义视频
    public final static String CUSTOMVIDEO = "/yjx/v1/document/customVideo";
    //获取自由创建配置信息_ APP_3_0 添加
    public final static String GET_CUSTOM_VIDEO_CONFIGURE = "/yjx/v1/sundry/getCustomVideoConfigure_app_v3_0";


    //删除
    // public final static String CLEARVIDEOBG_V1_0 = "/yjx/v1/document/clearVideoBG_v1_0";

    //  public final static String GETVIDEOBGINFO_V1_2 = "/yjx/v1/document/getVideoBgInfo_v1_2";
    // http://114.55.172.253:7000/mock/11/yjx/v1/document/getVideoBgInfo_v1_2
    //获取背景音乐列表
    public final static String GET_BGM_LIST = "/yjx/v1/sundry/getAudioAssetsList_app_v3_0";
    //自由创建作品
    public final static String NEWCUSTOMVIDEODOC_APP_V3_0 = "/yjx/v1/document/newCustomVideoDoc_app_v3_0";
    //修改自由创建作品
    //
    public final static String UPDATECUSTOMVIDEODOC = "/yjx/v1/document/updateCustomVideoDoc_app_v3_0";
    //获取自由创建作品预览
    public final static String PREVIEWCUSTOMVIDEODOC = "/yjx/v1/document/previewCustomVideoDoc_app_v3_0";
    //获取自由创建数据
    public final static String CUSTOMVIDEODOCCONTENT = "/yjx/v1/document/getCustomVideoDocContent_app_v3_0";

    //获取开屏弹框信息
    public final static String GET_AD_DIALOG_INFO = "/yjx/v1/sundry/getActivityWindowInfo_app_v6_6";

    //获取服务器地址
    private static String getAppServiceAddress() {
        //默认正式服务器
        String address = DEFAULT_ENCRYPT_BASE;
        String userChooseAddress = PreferencesHelper.getData(AppConst.KEY_SERVICE_ADDRESS);
        if (TextUtils.isEmpty(userChooseAddress)) {
            return address;
        } else {
            return userChooseAddress;
        }
    }


}

